package com.briup.service.impl;

import com.briup.bean.OrderLine;
import com.briup.dao.OrderLineMapper;
import com.briup.service.IOrderLineService;
import com.briup.util.MyBatisSqlSessionFactory;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author 王若龙
 * @CreateTime 2022-09-28 14:34
 */
public class IOrderLineServiceImpl implements IOrderLineService {
    SqlSession sqlSession = MyBatisSqlSessionFactory.openSession(true);
    OrderLineMapper orderLineMapper = sqlSession.getMapper(OrderLineMapper.class);

    @Override
    public void saveOrderLine(OrderLine ol) {
        orderLineMapper.saveOrderLine(ol);
    }

    @Override
    public List<OrderLine> findOrderLineByOrderId(Integer id) {
        sqlSession.close();
        return orderLineMapper.findOrderLineByOrderId(id);
    }
}
